// ==UserScript==
// @name           4chan Cancer Vision
// @namespace      darkflames430
// @copyright      2012 darkflames430 <darkflames430@gmail.com>
// @copyright      2011 Bento <mr_blank@bigfoot.com>
// @description    This blocks reasonable content.
// @include        http*://*.4chan.org/*
// @version        0.4
// @license        GNU GPL v2(MUST READ) <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
// @updateURL      https://4chan-chemo.googlecode.com/trunk/stable/4chan-chemo.user.js
// ==/UserScript==
var spamindex = "https://4chan-chemo.googlecode.com/svn/trunk/spam_index.txt";

GM_xmlhttpRequest({
	method: "GET",
	url: spamindex,
	onload: function(resp) {
	parse(resp.responseText);
	}
});
function parse(spam)
{
spam = spam.split(",")
console.log(spam);
	var posts = document.getElementsByTagName("blockquote"), post, pInner;
	for(var i = posts.length - 1; i >=0; --i) {
		post = posts[i];
		pInner = post.innerHTML;
		for(var a = spam.length - 1; a >= 0; --a) if(pInner.toLowerCase().indexOf(spam[a]) == 0) {
			post.title = post.textContent;
			post.innerHTML =  '<span class="spoiler">' +  post.innerHTML + "</span></br>{Cancer detected: " + spam[a] + ", post was deleted, roll over to read the blocked content}";
			break;
		}
	}
}